const router = require('koa-router')()
const superagent = require('superagent')
const config = require('../config/config')
const userAgentClass = require('../common/useragent')

// 引入服务层
const gameService = require('../service/service')

// superagent 请求
async function getHtml(url) {
  try {
    const result = await superagent.get(url).accept(config.accept).set('Referer', config.referer).set('User-Agent', userAgentClass.getRondom())
    return result
  } catch (error) {
    console.log(error)
    return ''
  }
}

module.exports = router
